package vue;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.JTextArea;

import modele.CKModel;

public class PanelText extends JPanel {

	static final long serialVersionUID = 12345;
	
	private CKModel<String, String> _modele;
	private VueEditeurCK _vue;
	
	private JTextArea txtC;
	private JTextArea txtL;
	private JTextArea txtK;
	
	public PanelText(CKModel<String, String> modele, VueEditeurCK vue){
		_modele = modele;
		_vue = vue;
		this.setPreferredSize(new Dimension(_vue.getFrameWidth(), _vue.getFrameHeight()/3));
		
		txtC = new JTextArea(_modele.printSC());
		txtC.setPreferredSize(new Dimension(_vue.getEditorFrame().getWidth()/3 - 10, 200));
		this.add(txtC, BorderLayout.WEST);
		
		txtL = new JTextArea(_modele.printTab());
		txtL.setPreferredSize(new Dimension(_vue.getEditorFrame().getWidth()/3 - 10, 200));
		this.add(txtL, BorderLayout.CENTER);
		
		txtK = new JTextArea(_modele.printSK());
		txtK.setPreferredSize(new Dimension(_vue.getEditorFrame().getWidth()/3, 200));
		this.add(txtK, BorderLayout.EAST);
	}
	
	public void setTextC(String mot){
		txtC.setText(mot);
	}
	
	public void setTextK(String mot){
		txtK.setText(mot);
	}
	public void setTextL(String mot){
		txtL.setText(mot);
	}
	
}
